import { requestClient } from '#/api/request';

type DeleteBatchParams =  {
  ids: string;  //ids字符串，逗号分割
  physics: boolean;  //是否物理输出,非必须
}

interface QualityTestingSaveParams {
  id: string;  //id,必须
  productNumber: string;  //生产订单号,必须
}

//获取质检报表列表数据
export const reqQualityTestingList = (params: any) => {
  return requestClient.get('/api/iotDeviceInspects/pages', {
    params
  });
};

//更新某质检报表的某条数据
export const reqUpdateQualityTesting = (data: QualityTestingSaveParams) => {
  return requestClient.put('/api/iotDeviceInspects', data);
};

//添加一条质检报表数据
export const reqSaveQualityTesting= (data: any) => {
  return requestClient.post('/api/iotDevicIenspects/pages', data);
};

//批量删除质检报表数据
export const reqDelQualityTestingBatch = (params: DeleteBatchParams) => {
  return requestClient.delete('/api/iotDeviceInspects/ids', {
    params
  });
};




//获取某段时间内的生产订单列表
export const reqProductOrderList = (params: any) => {
  return requestClient.get('/api/iotDeviceInspects/findProductOrdersByCreateTime', {
    params
  });
};

//给某段时间内的质检数据绑定生产订单
export const reqUpdateQuality = (params: any) => {
  return requestClient.get('/api/iotDeviceInspects/updateProductNumberByHours', {
    params
  });
};
